<html>
<head>
<title>
hc_admin_vmcenterindex
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel='stylesheet' type='text/css'
	href='../../extjs-4.1.0/resources/css/ext-all-gray.css' />
<style type='text/css'>
#top{ margin:0 0 0 0; width:100%; background:url(../images/top-bg.jpg) repeat-x; height:68px;}
#top_img{ float:left;}
#top ul{ width:900px; height:26px; line-height:26px; float:right; margin-top:45px; margin-right:5px;}
#top ul li{ width:200px; height:26px; line-height:26px; color:#fff; float:left;}
.red{color:#900;}
.red a,.red a:visited{color:#900; text-decoration:none;}
.red a:hover{color:red; text-decoration:underline;}
.blue{color:#006;}
a:link{text-decoration:none;color:black;}
a:hover{text-decoration:none;color:black;}
a:visited{text-decoration:none;color:black;}
.x-tab-inner{
	font-family:宋体,arial,verdana,sans-serif;font-size:12;font-weight:bold;px!important;
}
</style>
<script type="text/javascript" src="../../extjs-4.1.0/ext-all.js"></script>
<script type="text/javascript" src="../../js/head.js"></script>
<script src="../../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="../../js/i18n.js"></script>
<script type="text/javascript" charset="utf-8" src="../vmcentermanagement/vmCenterTree.js"></script>

<script type="text/javascript">
  Ext.onReady(function(){
		var params;
    MultiLang = (function() {
        return {
            init: function() {
                // load ExtJS locale
                params = getCookie("lang");
                i18n.set({
  				  lang: params, 
  				  path: '../../resources'
  				});
                if (params) {
                    var url = Ext.util.Format.format('../../extjs-4.1.0/locale/ext-lang-{0}.js', params);
                    Ext.Ajax.request({
                        url: url,
                        success: this.onLoadExtLocaleSuccess,
                        failure: this.onLoadExtLocaleFailure,
                        scope: this
                    });
                } else {
                    // no language found, locale of ExtJS will be english as default
                    //this.loadmyprojectLocale();
                	this.setup();
                }
            },
            onLoadExtLocaleSuccess: function(response) {
                try {
                    eval(response.responseText);
                } catch (e) {
                    //Ext.Msg.alert('Failure', e.toString());
                }
                //this.loadmyprojectLocale();
                this.setup();
            },
            onLoadExtLocaleFailure: function() {
                //Ext.Msg.alert('Failure', 'Failed to load locale file.');
                this.setup();
                //this.loadmyprojectLocale();
            },
            setup: function() {	
            	setParamCookie("vmID","");
				setParamCookie("nodeName","");
				setParamCookie("zoneCode","");
				//vmTreeReload();
				/*
  var store_vm = Ext.create('Ext.data.TreeStore', {			
		proxy: {
			type: 'ajax',
			url: path+'/../monitoring/oss!getNodeAndVmTree.action'	//equipment/            
		}
	  });
   var virsualManegementTree=Ext.create('Ext.tree.Panel',{	
		border:false,
		useArrows:true,
		autoScroll:true,
		store: store_vm,
		rootVisible: true,
		root: {
			text: i18n._('Overall'),
			icon:'images/overAll.png',
	        expanded: true        
	     },
		listeners:{
				  itemclick:{
					fn:function(view,record,item,index, e, eOpts ){						
					   if(record.isRoot()){
						   document.getElementsByTagName('iframe')[0].src='hc_admin_globalPage.html';//vmcentermanagement/
						   setParamCookie("vmID","");
						   setParamCookie("nodeName","");
					   }else if(record.isLeaf()){						   
						   document.getElementsByTagName('iframe')[0].src='hc_admin_vmPage.html?vmID='+record.get('qtip')+'';//vmcentermanagement/
						   setParamCookie("vmID",record.get('qtip'));
					   }else{						   
						   document.getElementsByTagName('iframe')[0].src='hc_admin_nodePage.html?nodeName='+record.get('text')+'';//vmcentermanagement/
						   setParamCookie("nodeName",record.get('text'));
					   } 					   
					}
				  }
			   }
		
	});	
	var aitem1 = Ext.create('Ext.Panel',{
		 id:"aitem1",
		 title:"<center ><span id='m1' style='width:100%;color:#04468C;font-size:10;font-weight:bold'>"+i18n._('vmmanagement')+"</span></center>",
		 //autoScroll:true,
		 hideCollapseTool:true,
		 layout:'fit',
		 items:virsualManegementTree
	 });
*/
     Ext.create('Ext.Viewport',{
		layout:{
			     type:'border',
				 padding: 5
			  },
	    defaults:{
			     split:true
			  },
		items:[
		
		{
		   region:'west',
		   width:160,
		   minWidth:160,
		   maxWidth:200,
			xtype:'panel',
            layout:{
				type:'accordion',
				columns:1
			},
			items:[aitem1]
		},//left		
		{
		id:'main',
		region:'center',
		border:false,
		xtype:'panel',
		layout:'fit',
		items:[{
		   xtype:'component',
		   width:'100%',
		   height:'100%',
		   autoEl:{
		   tag:'iframe',
		   name:'iframe',
		   src:'hc_admin_globalPage.html',//vmcentermanagement/
		   frameborder:'0px',
		   style:{
		    border:'0px'
		   }
		   }
		}]
 	   }
	  ]
	});//页面布局
	    

}
        };
    })();

    MultiLang.init();
    
});

 function getCookie(name){
         var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
         if(arr != null) return unescape(arr[2]);
		 return null;
 };
 function setParamCookie(field,value){
     document.cookie = field+"="+ value;
};
</script>
</head>
<body>
</body>
</html>
